<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../css/layui.css"/>
    <script src="/ehome/static/layui.js"></script>

    <script src="/ehome/static/lib/jquery-3.1.1.min.js"></script>
    <script src="/ehome/static/lib/jquery.cookie.js"></script>
</head>
<body>

<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(update)', function(obj){
            $.ajax({
                headers:{"token":"update"},
                url:"/ehome/sysUser.do",
                data:obj.field,
                type:"post",
                dataType: "json",
                success: function(returndata){
                    console.log(returndata)
                    layer.msg(returndata.msg);
                    if(returndata.code=="0"){
                        console.log(returndata.msg);;
                        layer.msg(returndata.msg)
                    }else{
                        console.log(returndata.msg);
                        layer.msg(returndata.msg)
                    }
                },error:function(e){
                    console.log(e)
                }
            });
            return false;
        });
    });
</script>
<form class="layui-form" action="">
    <div class="layui-form-item" style="width: 500px">
        <label class="layui-form-label" >选择分店</label>
        <div class="layui-input-block">
            <select name="companyId" lay-verify="required">
                <option value="0">武侯店</option>
                <option value="1">金牛店</option>
                <option value="2">青羊店</option>
                <option value="3">温江店</option>
                <option value="4">双流店</option>
                <option value="5">华阳店</option>
                <option value="6">其他...</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item" style="width: 500px">
        <label class="layui-form-label">用户类型</label>
        <div class="layui-input-block" >
            <select name="type" lay-verify="required">
                <option value="0">管理人员</option>
                <option value="1">客服</option>
                <option value="2">派送员</option>
                <option value="3">其他</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item" style="width: 500px">
        <label class="layui-form-label">ID 不可修改</label>
        <div class="layui-input-block">
            <input type="text" value="" name="id" required  lay-verify="required"  autocomplete="off" class="layui-input" readonly="readonly">
        </div>
    </div>
    <div class="layui-form-item" style="width: 500px">
        <label class="layui-form-label">工号</label>
        <div class="layui-input-block">
            <input type="text" value="" name="jobNumber" required  lay-verify="required"  autocomplete="off" class="layui-input" readonly="readonly">
        </div>
    </div>
    <div class="layui-form-item" style="width: 500px">
        <label class="layui-form-label">初始密码</label>
        <div class="layui-input-block">
            <input type="password" value="" name="password" required lay-verify="required"  autocomplete="off" class="layui-input"> 默认 123456
        </div>
    </div>
    <div class="layui-form-item" style="width: 500px">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-block">
            <input type="text" value="" name="userName" required  lay-verify="required"  autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" style="width: 500px">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-block">
            <input type="text" value="" name="phoneNumber" required  lay-verify="required"  autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" style="width: 500px">
        <label class="layui-form-label">身份证</label>
        <div class="layui-input-block">
            <input type="text" value="" name="idCard" required  lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" style="width: 500px">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="update">立即提交</button>
        </div>
    </div>
</form>

</body>
</html>